<?php

namespace App\Http\Controllers\Constant;

use Illuminate\Support\Arr;

class Constant
{
    const PROJECT_STATUS_READY = 0;//备审
    const PROJECT_STATUS_WAIT = 1;//待审
    const PROJECT_STATUS_COMPLETED = 2;//已审
    const PAY_TYPE_CLV = 1;//差旅
    const PAY_TYPE_CM = 2;//采买
    const PAY_TYPE_BX = 3;//报销
    const PAY_TYPE_FK = 4;//付款
    const PAY_TYPE_FP = 5;//发票
    const PAY_TYPE_JK = 6;//借款
    const PAY_TYPE_YJ = 7;//押金
    const PAY_TYPE_LK = 9;//临款

    const MANAGER_LIST = [215,223];
    const ROLE_SHEN_JI = 225;
    const ROLE_SALES_MANAGER = 213;
    const ROLE_CAIGOU = 212;
    const ROLE_ZONGJILI = 210;
    const ROLE_CAIWU = 218;
    const STATUS_ON = 1;
    const STATUS_OFF = 0;
    const ROLE_SJ = 226;
    const ROLE_SUPPER_ADMIN = [1,95];

    const FINANCE_CATEGORY = [
        ['type'=>self::PAY_TYPE_CLV,'title'=>'差旅'],
        ['type'=>self::PAY_TYPE_CM,'title'=>'采买'],
        ['type'=>self::PAY_TYPE_BX,'title'=>'报销'],
        ['type'=>self::PAY_TYPE_FK,'title'=>'付款'],
        ['type'=>self::PAY_TYPE_FP,'title'=>'发票'],
        ['type'=>self::PAY_TYPE_JK,'title'=>'借款'],
        ['type'=>self::PAY_TYPE_YJ,'title'=>'押金'],
        ['type'=>self::PAY_TYPE_LK,'title'=>'临款'],
    ];

    public static function getFinanceCategory($type)
    {
       $finance = array_column(self::FINANCE_CATEGORY,'title','type');
       return Arr::get($finance,$type,'差旅');
    }


}
